<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
//工作流设置
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'base';
$return=array();
if($_RQ['op']=='base'){
	$return['item']=pdo_get('jy_workline_set',array('uniacid'=>$_SESSION['uniacid']));
	$htmls=array(
			'type'=>'edit',
			'post'=>'basepost',
			'desc'=>'基本信息',
			'edit_tab'=>true,
			'tabs'=>array(
				'0'=>array('op'=>'base','title'=>'工作流设置'),
			),
			'edits'=>array(
				'0'=>array(
					'title'=>'基础设置',
					'list'=>array(
						array('type'=>'string','title'=>'中心标题','name'=>'title', 'help'=>'' ),
						array('type'=>'image','title'=>'图片','name'=>'picurl', 'help'=>'' ),
						array('type'=>'text','title'=>'默认小分类','name'=>'default_type', 'help'=>'多个分类可用|隔开' ),
						array('type'=>'text','title'=>'维修小分类','name'=>'bug_type', 'help'=>'多个分类可用|隔开'),
						array('type'=>'text','title'=>'服务小分类','name'=>'service_type', 'help'=>'多个分类可用|隔开'),
						array('type'=>'text','title'=>'项目小分类','name'=>'project_type', 'help'=>'多个分类可用|隔开'),
					)
				)
			)
		);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='basepost'){
	$postdata=get_postdata();
	$data=array(
		'title'=>trim($postdata['title']),
		'picurl'=>trim($postdata['picurl']),
		'default_type'=>trim($postdata['default_type']),
		'service_type'=>trim($postdata['service_type']),
		'bug_type'=>trim($postdata['bug_type']),
		'project_type'=>trim($postdata['project_type']),
	);
	$check=pdo_getcolumn('jy_workline_set',array('uniacid'=>$_SESSION['uniacid']),'id');
	if($check){
		pdo_update('jy_workline_set',$data,array('uniacid'=>$_SESSION['uniacid']));
	}else{
		$data['uniacid']=$_SESSION['uniacid'];
		pdo_insert('jy_workline_set',$data);
	}
	exi('设置成功！');
}
?>